home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol A-4 / (Vol A-4) Vol. A4.iso / Games / maquiagem-lana.swf / scripts / __Packages / mx / events / UIEventDispatcher.as < prev   
Text File  |  2007-11-28  |  3KB  |  101 lines

  1. if(!_global.mx)
  2. {
  3.    _global.mx = new Object();
  4. }
  5. §§pop();
  6. if(!_global.mx.events)
  7. {
  8.    _global.mx.events = new Object();
  9. }
  10. §§pop();
  11. if(!_global.mx.events.UIEventDispatcher)
  12. {
  13.    var _loc0_ = null;
  14.    mx.events.UIEventDispatcher = function()
  15.    {
  16.       super();
  17.    };
  18.    var _loc1_ = null;
  19.    mx.events.UIEventDispatcher.prototype = new mx.events.EventDispatcher();
  20.    mx.events.UIEventDispatcher = function()
  21.    {
  22.       super();
  23.    }.addKeyEvents = function addKeyEvents(obj)
  24.    {
  25.       if(obj.keyHandler == undefined)
  26.       {
  27.          var _loc0_ = null;
  28.          var _loc1_ = obj.keyHandler = new Object();
  29.          _loc1_.owner = obj;
  30.          _loc1_.onKeyDown = mx.events.UIEventDispatcher._fEventDispatcher.onKeyDown;
  31.          _loc1_.onKeyUp = mx.events.UIEventDispatcher._fEventDispatcher.onKeyUp;
  32.       }
  33.       Key.addListener(obj.keyHandler);
  34.    };
  35.    mx.events.UIEventDispatcher = function()
  36.    {
  37.       super();
  38.    }.removeKeyEvents = function removeKeyEvents(obj)
  39.    {
  40.       Key.removeListener(obj.keyHandler);
  41.    };
  42.    mx.events.UIEventDispatcher = function()
  43.    {
  44.       super();
  45.    }.addLoadEvents = function addLoadEvents(obj)
  46.    {
  47.       if(obj.onLoad == undefined)
  48.       {
  49.          obj.onLoad = mx.events.UIEventDispatcher._fEventDispatcher.onLoad;
  50.          obj.onUnload = mx.events.UIEventDispatcher._fEventDispatcher.onUnload;
  51.          if(obj.getBytesTotal() == obj.getBytesLoaded())
  52.          {
  53.             obj.doLater(obj,"onLoad");
  54.          }
  55.       }
  56.    };
  57.    mx.events.UIEventDispatcher = function()
  58.    {
  59.       super();
  60.    }.removeLoadEvents = function removeLoadEvents(obj)
  61.    {
  62.       delete obj.onLoad;
  63.       delete obj.onUnload;
  64.    };
  65.    mx.events.UIEventDispatcher = function()
  66.    {
  67.       super();
  68.    }.initialize = function initialize(obj)
  69.    {
  70.       if(mx.events.UIEventDispatcher._fEventDispatcher == undefined)
  71.       {
  72.          mx.events.UIEventDispatcher._fEventDispatcher = new mx.events.UIEventDispatcher();
  73.       }
  74.       obj.addEventListener = mx.events.UIEventDispatcher._fEventDispatcher.__addEventListener;
  75.       obj.__origAddEventListener = mx.events.UIEventDispatcher._fEventDispatcher.addEventListener;
  76.       obj.removeEventListener = mx.events.UIEventDispatcher._fEventDispatcher.removeEventListener;
  77.       obj.dispatchEvent = mx.events.UIEventDispatcher._fEventDispatcher.dispatchEvent;
  78.       obj.dispatchQueue = mx.events.UIEventDispatcher._fEventDispatcher.dispatchQueue;
  79.    };
  80.    mx.events.UIEventDispatcher.prototype = new mx.events.EventDispatcher().dispatchEvent = function dispatchEvent(eventObj)
  81.    {
  82.       if(eventObj.target == undefined)
  83.       {
  84.          eventObj.target = this;
  85.       }
  86.       this[eventObj.type + "Handler"](eventObj);
  87.       this.dispatchQueue(mx.events.EventDispatcher,eventObj);
  88.       this.dispatchQueue(this,eventObj);
  89.    };
  90.    mx.events.UIEventDispatcher.prototype = new mx.events.EventDispatcher().onKeyDown = function onKeyDown(Void)
  91.    {
  92.       this.owner.dispatchEvent({type:"keyDown",code:Key.getCode(),ascii:Key.getAscii(),shiftKey:Key.isDown(16),ctrlKey:Key.isDown(17)});
  93.    };
  94.    ┬º┬ºpush(mx.events.UIEventDispatcher.prototype = new mx.events.EventDispatcher());
  95.    ┬º┬ºpush("onKeyUp");
  96. }
  97. else
  98. {
  99.    ┬º┬ºpop();
  100. }
  101.